refactored to fix bug in channel_close test. As a consquence can no longer break out of waituntil statements that have an and