Bug fix: change boundary condition to be more inclusive