State has to pay legal fees