fixed a minor bug of logging