fixed NPE on invoking