fix bug in element matching for ec2 slaves