Fix issue with job message and json encoding (some loop appeared in some use cases)