Fix check for existing device