Fix index for toggling while removing elements from header table