adds event listeners