added new id system and duplication and json fixes