fix: null pointer check