toggle command added, open function reworked