Added some new event handling.