added method setConfig mainly use for setting on or off debug messages