changed error handling, now sensor in general is more performant