fixed null pointer exception in NodeCollection