State told to get its house in order