fixed error in SQL