Add explicit check for null