prevent null pointer exception