added chain foreignkey to x resource