hits all the nodes but NullPointerException at the end