minor fixes on historyFileCreation function