logic change for getting id