CON-1809 | Fix overlapping of anchored element

please check the comment above about using globals