correcting position of empty elements