working same way it did in mock