fixed updating the related models
Fixed definition of related models