corrected last query