save and load script improved