is there a way we can do this with latches instead of sleeps?