improve logger & fix bug init