Add token validation function