Added before_new and after_new functions