Added dynamic timeout value. Issue #2.