fix output size check bug