fixed some errors saving