fix Uri handling bug