Fixing last character stuff on JSON so that it will not delete the previous ending hash end-bracket