added validation for devices