# Comparison of lattice energy

Which compound has largest amount of lattice energy among $$\ce{AlF3}$$ and $$\ce{AlN}$$. I think it should be $$\ce{AlF3}$$ because lattice energy in inversely proportional to radius and size of flourine is quite small as compared to nitrogen. Talking about charge then both have charge of magnitude 3 but my textbook says $$\ce{AlN}$$ has higher lattice energy could you explain