update end space index