modified backup function so it does not create nested backups