Make query_post category name dynamic

Use get_the_title() replacing the_title(). Difference is get_the_title() returns the value while the_title() echos it.