change the mechanism of handling margin&bound