key_directory condition got flipped, semantically