modified update funciton for app_key