Better fix for style flickering on slide transition