removing nodes caused NPE. this is now fixed