fixing saving and loading