Added broken state saving and loading