found an corrected a bug at the keymanagement