Added logging to help with debugging