ensure id set if not set after save