fix bug
write test for has_many and through