catch errors when dealing with malformed or truncated input
added shell script