adding in logging to get better detail out.  a little better error handling here and there