fixed sql query error.