logging and bugfix