Added debugging for empty id