check for correct number of arguments in closure call