using blocking instead of wait