change close to hide function when click on overlay, pressed esc and autobind triggers