autogenerate resource id if not present