nullcheck for mode