Fixed the relation between tables