working on active key detection