properly cleanup Python objects