Added methods to set the update and exit functions.