fixed boundary error