fixes the figure number bug