execute ps once for efficiency