fixed bug with AfterNew event