imporve component open function