automatic token renewal! edge cases fixed