inputstream close bug fix