fixed some kind of bugs