fixed habtm and db