fixed sql statement