Added cleanup functionality