We study phase transition from the Mott insulator to superfluid in a periodic optical lattice. Kibble-Zurek mechanism predicts buildup of winding number through random walk of BEC phases, with the step size scaling as a the third root of transition rate. We confirm this and demonstrate that this scaling accounts for the net winding number after the transition.