corrected the query