Update and fixed some bugs