Changed calculation of unique id