Thanks for that catch, not sure how I missed that one!

The $logger is only created in the above conditional that has the same check, so this should work okay (and works fine for $stepStartTime in the same method