fix batch random