checking whether user has logged in