Prevent null pointer de-reference