Token lifetime extension and bug fixed