adding before_deliver callback