bugfix, improved logging