fix formatData to recursion