Fix bug with logging method