Replace ValueError with MFRExeption exceptions can be handled.