Added event handling.