Fix init and add log file