Modified the solution for extended timeout