fixed bug in HABTM join table for subjects and classes