could not convert with type dict was not a sequence or recognized null for conversion to list type