fix fail on close frame by mouse