fix boundaries issue