fix incorrect EC2 state check