fix random tests failing due to randomness