fixed a logging bug