correct totalSum & editing off if view disappear