fixed sql statement error