version adding infinity check