fixed NPE found by Mithun