started adding debug logging