fixed mkModes memory bug