fix for possible flickering/rendering errors