fixed a bunch of issues