Changed mocking hack to correct behaviour