refine timeout mechanism