- fixed some code error and add some test