repair sensor function