Appium grid : request not sent to specified udid

I have setup selenium grid for parallel execution with two real android devices having different android versions. I am using maven as a build tool and passing udid as a parameter. when i run the script first time then the request goes to the correct device (Device1) but when i trigger the script again with the same udid which I passed for the first execution, then the request should go to device 1 in queue (as we have triggered the first request on this device) but instead the request is going to available Device2 having different udid.

My question here is why the request is not going to the specified udid but going to the available device? Can someone help me pls.

below is my base page code for Capability

udid = properties.getProperty("udid"); cap.setCapability(MobileCapabilityType.UDID, udid); cap.setCapability(MobileCapabilityType.AUTOMATION_NAME, “Appium”); cap.setCapability(MobileCapabilityType.AUTOMATION_NAME, “uiautomator2”);

below is my command for trigger the maven mvn install -Dudid=036b604c9906