updated cleanup function