minor logic change