if ($User === false) {
            throw new InvalidArgumentException("No or invalid user object provided"); 
        }