fixed some bugs, optimization