Fixed a bug in main on sensor