Updating z-index for popups