fixed sensor script