decrement number of index when close tab