add cancel function to utils