enhance debug log
fix minor bug