Adding onException callback