Fixed bugs in saving process so the info is avaiable to output.html