synch and cleanup