model declaration error and associations fix