fixed read, write, link errors