Added more logging code