Add major bugfix to save func