fixed rand in demo