slightly changed
improve parse_redirection