cleared up some bugs