changed to clear timeout on error as well