Fixed database issue with missing sensor id