fixed two bugs with read counting