fix message length

- getline seems to not return correct len information
add fail option