fix for losing private key while being logged in and accessing a public link
fix for undefined index