Added code to set loglevel