add aditional check to detect valid device