fix bug with uid generation