add mutex locking to channel