fix sharing permission bug - fixes #733