Implementing exponetial timeout.