small fix on sql