Getting "Invalid token error" in historical data