add debug code, DO NOT MERGE