fixed some issues with models and associations