split stdout, stderr in isValid method.