move "++current_restart_index" to OnKeyAdded