added event listeners for dom events