fix error when end and obs, then shutdown it