Fix for getUrl sometimes not working as expected