Added util function to load a resource