Fixed bug when cancelling edit