fixed the first wave of bugs