Added asResource global function