fixed bugs in normalize_resource_name