with some extra logging