prevent nullpointer exception