trying to avoid flickering