added event listener to view.