moving event listener creation to onResume