fixed bug in authentication