Added check if logged in