fix the closing problem of div