check for NULL query