fix saving and opening