bug fixed for nonblock stdio