add more debug log and fix formatter.py skipping order