Fix bug with authentication