authorize_key function added