add logging functions