Fixing a null crash