small logic change