Correcting a display bug due to z-index