avoid null pointer exception