fixing week boundary condition bug.