fixes the cleanup system