added open-close feature