use chan struct isntead of chan bool