added mobile friendly event handling