Added email state machine