modified to scale by apps