Loading previous state on startup still goes on forever