Fixed a slight problem with the event handler.