Fixed browser close bug.