use row_number() in order to have a unique id

Merge this PR after the deploy of 20.08.2014.