improved logging. fixes #2