fix logging bugs