fix usage of key