added open close with js