fixed eof bug
updated after ec2 test