removed unnecessary locking, which might have created deadlocks. removed find_chan_by...