fix boundaries