preventing errors when setting empty id if no fields existing