Fixed bug where expired tokens were not refreshed