added getreadcount function