fixed logging bug