added remove temp private key logic