modified mock.py