Added optional authentication