Added key checking