fix for error in closure