Applying foreign Key