Updated the query to be much faster