bugfix when handling shared data