Data logging working properly