Fix checkJsonError messages

The $value string was not set inside checkJsonError, so it was not possible to see the data which caused the error