use channel. there's still a bug when channels get closed