Problem 7: added function code to handle cancel pending and added testcases for cancel pending