fixed "eq" function