fix things up
fix issues on authentication detection