fix recursive cleanup