Adds working logout code.