fixed logging bug.