criteria and query fixed