fix sql statement error