fixed some potential issues related to logging