fixing scala bundle toJsonBytes