handle null queries