close button js bug fix