adding add_key functionality