fix a lot of bugs part 2