fixes query in update_all_account_profiles