properly generate id