+ added token check function