Fixed the SQL