added catif function