fixed error during saving