Fixed updating wrong generation