fix get buf timeout algorithm (check against our document at the end, not the start