Update and fixs some bugs