Bug fixing of boundary condition