fix save and recovery