added clean exit strategy