tweaked the key expiration checking function, and replied to SJJ's bug