fixed varying read length issue