fixed potential duplicate resources problem