updated read on nonblocking