added pipe handling for more complex commands