Fixed a bug on two factor auth