fixing sql statements oops