fixing error in SQL syntax