Fixed handlePersonaState to take flags into account