Create directory before adding key to it.