fix warning and speedup authentication