channel works across thread with the help of a mutex