added auto align margins