Fixing NaN in logic for shares