add logging for troubleshooting