fix inputstreamat bug