fix for #305
Merge pull request #307 from NICTA/share_fix

fix for #305