Fixed modal flicker problem