use appid instead of frameworkid; simplify stupid condition