sql query fix
EE fix