Avoid null pointer error