minor fix: sanitizing the query and field.