added updateResource() method to check if resource is being updated