Add cleanup function.