Implement custom callbacks for done and back buttons.