add backup and restore function