changing random method

changing random method for generating new ids