Fixed a bug with repeating IDs