added more error handling in parse_argv()