Make query operation work with users