modfify some const
add counter to index