Fix: illegal state bug in email detail view