Add in more logging statements to trace error