fix bug that stopped type being set