Adding the on delete set null to avoid delete errors