update style and index