Fixed save-function