fix resource url function