bug fixes and logfile