added open and close