added a flag for isloggedin