fix close_and_clean