fix bottom /top margin reversal bug