check not null first