saving state for merge