fixed an error with an sql string