fixed hang on read