Changed the get_topics_by_category sql statement to use join