added js to auto bracket close functionality