fixed issue of duplicate queries
fix bug comparing classes