fix issue #255 - cancel a pending operation only if there is an operatio...

...n pending