Using find_by instead of where and added topic_id in condition