fixed logic of intranet security - need to write tests