updated all the queries for new where