Added locking for sensors