Remove function defintion from loop.