bug fixes for authentication