Added check for login to see if a user was already logged in. Fixes #2.