Added input event handler