fixed FK logic