Added check of read bytes