fixs some bugs