Minor change to the generate random id function