bugfixes and logger