hook to remove related resource on collection delete
adding  to resource function
more improvement to derivatives