fixed id generation problem