fix error when resource is new