added KEY_PAIR option for template