improving log messages, error checking
4 files changed