added new masonry patch to preserve order of elements