fix cast to URI, formatting