updating margins