moved open function
moved open function