Fix key pair generation bug if previous keys do not exist
Fix key pair generation bug if previous keys do not exist

crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp