added "timeout" feature