fixed sql issue.