Fix the bug in authentication