fixed bug so that user is logged in if previously logged in before.