Added checks for backup directory