remove blob code and read length only once it for loops