fixing the "blinking" bug.