check and fixed some old code long long ago.