fixed nullpointer when adding item