fix for boundary condition