fixed typo in sql query