Fix appid detection on error pages