auth function return fix