Fix shadow flickering issue