added guard i type function (for efficiency)