fix a keypair issue and add securitygroup as option