adding basic event handling