sql minor fix