changed system to avoid NPEs