todo is assigned an object in the call back of 'data' event,
which means todo.length will be evaluated null, which means
the if block following todo.length === todo_len will never
be executed. This commit fix this bug