do proper clean up exit