fixed some bugs, still having problems with sharing