small bug on boundaries