As suggested by @Brits, moving close(mod_channel) to the end of the dummyFilter solved the problem. Many thanks!
close(mod_channel)
dummyFilter