created a method to cancel the transaction