use auto and range based for where acceptable, increase wait to 1 sec from 0 in future.wait_for()