fix some bugs and add possible array of open and close buttons