Added a function to check whether custom_token is valid or not.