refined the console log for debug.