small bug fix when browser tab gets focus