Use pagebeforehide to stop processes earlier