moved open function