check for login before initializing