move into is own function the check of keys defined in privileges