added double margin bug fix