fixed some bugs
fixed a lot of bugs