mod. check for existence of flask-login before setting flag.