add check for app_key and app_secret