protect against empty queries