Add new options in activate_code and bug fix in code_validation