fixed resoveUrl to resolveUrl and refact it