fixed some bugs, still some remaining