Added error checking after parse_input.