flask cleanup