Fixed data logging - should work fine now