removed close(channel) which prevented iterating over the code multiple times