added clearLog function