fixed overwritting bug