update before cleanup