fixes #50 application hang on cancel reading fixed