fix errors ref in login func