making check_token function, but failed due to synch.