Added some basic event handling