Make timeout configurable, and make default timeout 1 second