Changes for devices and SQL