Added sensor code checking