adding check for login