Added check for backupdir