Only set Id on document if it was given