offline/online event handlers.