I feel we don't need an extra variable msg here just for printing debug log. please merge the two lines.