Save function works now