added constant LOOP_TIMEOUT = 300ms