fixed a lot of issues