finish implementing authentication