fix Dima's state-preservation bug