macro tweak to avoid dividing by 0