fixed afterMethod for tests