Bug Fixing Closure Function