fixed critical bug in `read`