bug in iter, epoch switch