Added loop for multiple read() calls