resolving string url to test if exist, and fixing KeyError