Update to better authentication code