Adding beforeExit stuff to staging_web, to fix breakages