better auth handling