added menu and event handling