check directories exist before making links