add function to check token