implement backup and save of buffer