logger code has a problem when adding a global attribute. fix later.