Removed do while in receiving the header.