fixing tons of bugs