adding a null check that was crashing server