fixed init with JSON bug