fixed boundary issue