change random to hash