added more extensive logging