avoiding nullpointer