Fix token check