fix and more logging