Added key locking feature