Added the ability to logout when the program is a register.