solve some bugs and add LOG info