replaced i to i - 1 in checkTempMan function (globs.js)