fixed restore script for situations where restorecname was unset