fix ra warning, better close