Make timeout adjustable

Make timeout length adjustable via constructor.