init tpcorr_map in outer scope