Fixes saving the state after an unit has been added