Correct function scope