Modifying code so it works for get Device in View works.