Prevent width flickering in thread