Updated delete_device function to include new table