added token validation checks and alerts