fixing datalogging