cleanup and sync