Fixed log in/out crash

Fixed the issue in which after logging out you are unable to log back
in.