check to prevent flicker