Added logging to trace problems