fix timeout check, see #18