add page visible change event handler