added getReadLength function
fixed bugs for getting read length