fix code for cancelling channel operations