Fixed error that assumed user was logged in