add nulle test prevent nullpointerException