trying to fix some bugs