Moved the log statement with a var in it, to below the var declaration.