+ added open function
+ added error handling and return status for open/close