fixed mock functionality