updated for ec2 compatibility