rewrite the add and sub of resource