Fixed problem of multiple timeout handlers overlapping and updating the state too frequently