Solve input stream block issue