fix bug on authentication