improved auth and path handling