check for undefined query values and return empty queries