move event listener to Register