fixed readFrom function