onExit callback.