use timeout, not Thread/sleep