Dynamically change size of types array