added preconditions to keygroup