add locate resource function