fixed sql.