fix bug with index field