switched to $log for debugging