creating Nested IF statement rule for VM