if I click end-button, the detail side'll close
fix error catching