modified implementation of has_many in index action
quick fixed a bug in index actions