Hello nagarjun,
I am not sure, but if the function create an unique id, it have not to create the same id two times. Because of this, I think the unique id depends on different (internal) parameters for example the time. The time is every time different, so you get different id every time. (a lot of time^^)
In my opinion you have to use another function or write your own function.
Regards
Severin