Added cleanup function.