query fix
sql fixed