Fixing bug in model associations