bugfix in reader, debug messages
refactor logging