fix backup and restore bug