fixed NPE, added notify:true/false option