leaf boundary fix