fixing cases where result cant be parsed as json