rebased against onpeerready fixes