added cancel functionality