Added Available device code detection code