updated to show error message and echo no extra pipe command
updated error handling and echo command