Fix crash on back while editing