event handling for message box is working