added optional authentication