small adjustment to include passed data in the beforeEnd function