Fixed a bug in AWS EC2 general refactor