fix positive margin bug