fix for z-index calculation