Updated key storage method