Changed way of generating ids.