retry when connection terminated, fixes #14