Fix double openning of the log file