Added functionality to devices.php