fixed test (mock instead of a temporary change)
do not shadow a local variable

removed conflict between block argument and a local variable