remove unnecessary null pointer check