fix bug in beforeEach