fixing clousure bug