modified test to check if the method was called