constrain reading to avoid hangs