Fix a null pointer error i received