Fix invalid cleanup

Fix invalid cleanup