add logging for debugging