Implemented event handlers.