Fixing bug with calculating share