add index and update header