Changed update function to save
Bug fixed