implemented the loginrequired flag