public key detection added