Made Mage.cs serializable