Flicker issue for modal window