fix bug in parse_request