Added events and dom utility functions