fix variable scope + display click history in test case.