why is this happening in beforeEach()?