Changed query to use LIMIT