fixed a bunch of errors