fix existing key detection