Fixed canceling of edit mode and session expired issues