trim the string before json decode