Virginia officials scramble to restore funding for charities