Made the cancel functionality work.