handle piped commands