Grothendieck-Lefschetz fixed point formula and stacks