read() checker added to reduce errors