update cancel function